package com.bamboo.toolbox.exporter.action;

import com.bamboo.toolbox.exporter.dialog.ExportTableDialog;
import com.bamboo.toolbox.exporter.model.Database;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;

import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
import java.util.List;


/**
 * @author luzhiqing
 * @version 1.0
 * @date 2022/10/21
 */
public class ExportTableAction extends AnAction {

    @Override
    public void actionPerformed(@NotNull AnActionEvent event) {
        Project project = event.getProject();
        if (null == project) {
            return;
        }
        List<Database> databases =
                Arrays.asList(
                        new Database("选择目标DB", "", "", "")

                );


        String basePath = project.getBasePath();
        ExportTableDialog swapDialog = new ExportTableDialog(
                project,
                databases,
                basePath
        );
        swapDialog.setSize(600,500);
        swapDialog.setTitle("ExportTables");
        swapDialog.init();
        swapDialog.setModal(true);
        swapDialog.show();
    }
}

